<template>
  <div>
    <h1>日志一览</h1>
    <br>
    <el-date-picker v-model="startTime" type="date" value-format="YYYY-MM-DD" style="width: 15%"
                    placeholder="起始日期">
    </el-date-picker>
    <el-date-picker v-model="endTime" type="date" value-format="YYYY-MM-DD" style="width: 15%"
                    placeholder="结束日期">
    </el-date-picker>
    <el-button type="primary" @click="search()">查找</el-button><br><br>
    <el-row>
      <el-table :data="goodsList" stripe>
        <el-table-column prop="logTime" label="日期"></el-table-column>
        <el-table-column prop="logInfo" label="内容"></el-table-column>

      </el-table>
      <el-pagination v-model:current-page="curPage" v-model:page-size="pageSize"
                     background :total="total" @current-change="changeCurPage()"></el-pagination>
    </el-row><br>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "Journal",
  created() {
    this.search()
  },
  data(){
    return{
      goodsList:[],
      supplier: {},
      startTime:'',
      endTime:''

    }

  },methods:{
    search(){
      let param=new URLSearchParams()
      param.append("startTime",this.startTime)
      param.append("endTime",this.endTime)

      axios.post("/api/log/query").then(res=>{

        this.goodsList=res.data

      })
    }

  }
}
</script>

<style scoped>

</style>